<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--
        编程实现会员抽奖程序，会员号是一个三位数字，如果会员号的三位数字的和是21则中奖，否则不中奖
-->

<script>

    var  number = Number(window.prompt("请输入会员号"))

    var  gw = number%10
    var sw = parseInt(number/10)%10
    var bw = parseInt(number/100)

    if ((sw+bw+gw)==21){
        console.log("恭喜你中奖了")
    }else{
        console.log("谢谢惠顾")
    }




</script>
</body>
</html>